package com.vogue.supplymall.order.domain.service.impl;

import com.vogue.ssm.database.dao.BaseDao;
import com.vogue.supplymall.order.domain.dao.OrderCancelDao;
import com.vogue.supplymall.order.domain.model.OrderCancel;
import com.vogue.supplymall.order.domain.service.OrderCancelService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * The type Order cancel service.
 *
 * @aouthor: zhangliang
 * @date: Create in 2018-03-12
 */
@Service("orderCancelService")
public class OrderCancelServiceImpl extends BaseServiceImpl<OrderCancel, Long> implements OrderCancelService {
    @Resource
    private OrderCancelDao orderCancelDao;

    /**
     * Instantiates a new Order cancel service.
     *
     * @param baseDao the base dao
     */
    public OrderCancelServiceImpl(BaseDao<OrderCancel, Long> baseDao) {
        super(baseDao);
    }

    @Override
    public OrderCancel getOrderCancel(Long orderId) {
        List<OrderCancel> lists = orderCancelDao.getOrderCancel(orderId);
        return (0 == lists.size()) ? null : lists.get(0);
    }

    @Override
    public List<OrderCancel> searchOrderCancel(Long orderId) {
        return orderCancelDao.getOrderCancel(orderId);
    }
}
